//
//  XS_Utils.swift
//  Pods-XS_Utils_Tests
//
//  Created by 韩云智 on 2020/7/14.
//
//  iOS 框架通用工具

import SnapKit
import RxSwift
import RxCocoa
import RxAlamofire
import RxDataSources
import SDWebImage
import Toast_Swift

/// 仅在开发模式下执行的代码
/// - Parameter debug: 需要执行的代码闭包
public func xsDebug(_ debug: (()->())?) {
    #if DEBUG
    debug?()
    #endif
}

/// 获取系统当前window
/// - Returns: UIWindow
public func xsWindow() -> UIWindow? {
    guard let delegate = UIApplication.shared.delegate, let window = delegate.window, window != nil else {
        return UIApplication.shared.keyWindow
    }
    return window
}
